export default {
  'background-color': 'rgba(50, 50, 50, 0.06)',
  'search_bar-color': 'rgba(50, 50, 50, 0.08)',
  'border-color': 'rgba(50, 50, 50, 0.2)',
  'loading-color': 'rgba(0, 150, 250, 0.8)',
}
import { debounce } from 'lodash'
// 设计稿基准宽度(px)和基准font-size(通常1rem=100px便于计算)
const BASE_WIDTH = 1920
const BASE_FONT_SIZE = 100

export const initRem = () => {
  const docEl = document.documentElement
  const resizeHandler = () => {
    const clientWidth = docEl.clientWidth
    docEl.style.fontSize = `${(clientWidth / BASE_WIDTH) * BASE_FONT_SIZE}px`
  }
  resizeHandler()
  window.addEventListener('resize', debounce(resizeHandler, 300))
}

// px转rem工具函数
export const px2rem = (px) => `${px / BASE_FONT_SIZE}rem`
